#include <stdio.h>

int sequencial_search (int a[], int s, int f)
{
	int i, flag=0;

	for (i=0; i<s; i++)
	{
		if (a[i] == f)
		{
			flag = 1;
			return 1;
		}
	}
	if (flag == 1)
		return 1;
	else
		return -1;
}


main ()
{
	int s, a[10], f, i, x=0;	

	printf ("Enter list size:\t");
	scanf ("%d", &s);
	
	for (i=0; i<s; i++)
	{
		printf ("\nEnter %d element:\t", i);
		scanf ("%d", &a[i]);
	}

	for (i=0; i<s; i++)
	{
		printf ("%d\t", a[i]);
	}

	printf ("\nEnter the element to find:\t");
	scanf ("%d", &f);

	x = sequencial_search (a, s, f);

	if (x == 1)
		printf ("\n Found in the list");
	else if (x == -1)
		printf ("\nNot found");
	else
		printf ("\nx = %d", x);

}
